from Base import message, intersect, SS_VALID
from DRG import MDCT_DRG

def group(record):
  adrg_zd = ["F52.000","F52.001","F52.100","F52.100x002","F52.100x011","F52.200","F52.200x002","F52.201","F52.202","F52.300","F52.400","F52.500","F52.600","F52.700","F52.800","F52.900","F64.000x001","F64.000x002","F64.100","F64.200","F64.800","F64.900","F65.000","F65.100","F65.200","F65.300","F65.400","F65.500","F65.500x001","F65.500x002","F65.600","F65.800","F65.900","F66.000","F66.100","F66.200","F66.800","F66.900"]
  adrg_zd1 = []
  adrg_ss = []
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and (not record.ssList or not intersect(record.ssList[0],SS_VALID)):
    message('符合TX1入组条件，匹配规则：主诊断匹配')

    if MDCT_DRG.TX19_group(record):
      return 'TX19'
        
    return 'TX1'
  else:
    return ''
    
